import { HttpClient } from '@angular/common/http';
import { Inject, Injectable } from '@angular/core';
import { API_CONFIG, ServiceModule } from './service.module';

@Injectable({
    providedIn: ServiceModule
})
export class RequestService {

    constructor(private http: HttpClient, @Inject(API_CONFIG) private uri: string) { }

    get(path: string) {
        return this.http.get(this.uri + path);
    }

    delete(path: string) {
        return this.http.delete(this.uri + path);
    }

    put(path: string, data: any) {
        return this.http.put(this.uri + path, data);
    }

    post(path: string, data: any) {
        return this.http.post(this.uri + path, data);
    }

}